//This class handles all the fighting 
package com.sjsayers.jtbae.fight;
import com.sjsayers.jtbae.creatures.*;
public class Arena {
	/**
	 * This method does it all when it comes to JTBAE Fighting. It handles all fighting including death, random damage and gaining EXP.
	 * 
	 * @param player the player object is for the end user.
	 * @param creature the creature object is the AI encounter.
	 */
	public void Fight(SuperCreature player, SuperCreature creature){
		//this is supposed to handle all the work for starting a fight without having to know how the fight system works.

		doFight(player, creature);
	}

	private void doFight(SuperCreature player, SuperCreature creature){
		//After all the fight attributes have been loaded this is the fight.
			while(player.getCreatureLifeStatus() == true && creature.getCreatureLifeStatus() == true){
				System.out.println("You: " +player.getHealth()+ " Monster: " + creature.getHealth());
				//This will take the strength of one creature and do subtract that int value of the opposers health. 
				player.decHealth(creature.getRandomDamage());
				creature.decHealth(player.getRandomDamage());
			}
			if (player.getCreatureLifeStatus() == true){
				player.incExp(creature.getExp());
			}
			else {
				System.out.println("Haha you died.");
			}
	
			
		}
	


	
	}
	

